package com.partner.boot.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import cn.hutool.core.annotation.Alias;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
* <p>
* 用户表
* </p>
*
* @author 刘孟坤
* @since 2023-07-30
*/
@Getter
@Setter
@ApiModel(value = "User对象", description = "用户表")
@TableName("sys_user")
public class User implements Serializable {

private static final long serialVersionUID = 1L;

    // 主键ID
    @ApiModelProperty("主键ID")
    @Alias("主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    // 用户名
    @ApiModelProperty("用户名")
    @Alias("用户名")
    private String username;

    // 密码
    @ApiModelProperty("密码")
    @Alias("密码")
    private String password;

    // 昵称
    @ApiModelProperty("昵称")
    @Alias("昵称")
    private String name;

    // 用户唯一标识
    @ApiModelProperty("用户唯一标识")
    @Alias("用户唯一标识")
    private String uid;

    // 电子邮箱
    @ApiModelProperty("电子邮箱")
    @Alias("电子邮箱")
    private String email;

    // 创建时间
    @ApiModelProperty("创建时间")
    @Alias("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    // 更新时间
    @ApiModelProperty("更新时间")
    @Alias("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    //逻辑删除字段
    @ApiModelProperty("逻辑删除字段")
    @TableLogic(value = "0",delval = "id")
    private Integer deleted;

    public User(Integer id, String username, String password, String name, String uid, String email,
                LocalDateTime createTime, LocalDateTime updateTime, Integer deleted) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.name = name;
        this.uid = uid;
        this.email = email;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.deleted = deleted;
    }

    public User() {
    }
}